package com.ilxqx.framework.system.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * Swagger配置
 * @author venus
 */
@Configuration
public class SwaggerBeanConfig {

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(this.apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.ilxqx.framework"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("大名鼎鼎的Framework快速开发框架")
                .description("这是一款超级牛逼的快速开发框架，它历经无数个日日夜夜的磨炼和改造，是作者最为真实且全身心投入的创作！")
                .version("1.0.0")
                .contact(new Contact("冷笑浅兮（Venus）", "https://www.ilxqx.com", "iweixiaopeng@163.com"))
                .build();
    }

}
